// pages/user/integral/index.js
const config = getApp().globalData.config
const T = getApp().globalData.T
let token = ''
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list:[],
    isLoaded: false,
    isFirstTip: false,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    token = getApp().globalData.token;
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
      this.getDetail();
  },

  getDetail() {
    T.req({
      loadTitle:'加载中...',
      url: config.api + 'point/total',
      method:'GET',
      data:{
          token: token
      },
      success: (res) => {
        this.setData({
          obj: res
        })
      }
    })
  },

  onReachBottom() {
    console.log('加载更多')
  },

  onRule(){
    wx.navigateTo({
      url: './rule/rule',
    })
  },

  onPriceParticulars() {
    wx.navigateTo({
      url: './particulars/particulars',
    })
  },

  onCheckDetail(e) {
    let id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: './goods-detail/detail?id=' +  id,
    })
  }
})